/**
 * 是否是视频格式
 * @param filename
 */
export const isVideoFormat = (filename: string) => {
  const formats = /\.(mp4|m4v|flv|mpeg|webm|mov|mkv)$/i;
  return formats.test(filename);
}
/**
 * 是否是音频格式
 * @param filename
 */
export const isAudioFormat = (filename: string) => {
  const formats = /\.(mp3|wav|aac|ogg|flac|raw|m4a|wma|mp2|ra|ram|au|aif|aiff|aifc|mpga|mp4a|pac|svx|xma|adts|mka|opus)$/i;
  return formats.test(filename);
}
/**
 * 是否是图片格式
 * @param filename
 */
export const isImageFormat = (filename: string) => {
  const formats = /\.(png|ico|jpg|jpeg|webp)$/i;
  return formats.test(filename);
}
/**
 * 是否是压缩格式
 * @param filename
 */
export const isZipFormat = (filename: string) => {
  const formats = /\.(gz|zip|7z|bar|tar)$/i;
  return formats.test(filename);
}
